package cn.dnui_zjs008.dnuifood_.model;

import cn.dnui_zjs008.dnuifood_.iface.ShopIface;
import cn.dnui_zjs008.dnuifood_.listener.OnRetrofitListener;
import cn.dnui_zjs008.dnuifood_.service.ShopService;
import retrofit2.Call;

public class ShopModel extends BaseModel
        implements ShopIface {
    private ShopService service;
    public ShopModel(){
        super();
        service = retrofit.create(ShopService.class);
    }
    @Override
    public void getAllShops(OnRetrofitListener listener) {
        Call call = service.getAllShops();
        bindCallBack(call,listener,1);
    }

    @Override
    public void getFoodByShop(String shop_id, OnRetrofitListener listener) {
        Call call = service.getFoodByShop(shop_id);
        bindCallBack(call,listener,2);
    }

    @Override
    public void getShopById(String shop_id, OnRetrofitListener listener) {
        Call call=service.getShopById(shop_id);
        bindCallBack(call,listener,3);
    }
}
